<template>
  <div class="hello">
    <button @click=add(4)>+</button>
    <span>
      {{ num }}
    </span>
    <button @click="sub(8)">-</button>
  </div>
</template>

<script>
import { mapState,mapMutations } from 'vuex'
export default {
  
  name: 'HelloWorld',
  props: {
  },
   data () {
    return {
 
    }
  },
  computed: {
    ...mapState(['num'])
  },
  methods: {
    ...mapMutations(['add','sub']),
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">

</style>
